/*
 * Copyright 2013 Agustina Martinez-Garcia

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
package uk.ljmu.qudexapps.xmllib.utilities;

import java.util.HashMap;

public class Constants {
    /* GENERAL CONSTANTS */
    public static final String DEFAULT_INLINE_DS_NAME = "RDF_DS";
    public static final String DEFAULT_RELSEXT_DS_NAME = "RELS-EXT";
    public static final String PID_DELIMITER = ":";
    public static final String ISO_8859_1 = "ISO-8859-1";
    public static final String FED_DEF_VERSION = "3.4.2";
    public static final String DEFAULT_MIMETYPE = "text/xml";
    public static final String FIELDS_SEPARATOR = ";";
    public static final int VERSION_MAX_DIGITS = 4;
    public static final String XML_VERSION_HEADER = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
    public static final String XML_UTF_VERSION_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
    public static final String NOCOLLECTION = "nocollection";
    public static final String DC_LANGUAGE_UNPREFFIXED = "language";
    public static final String DC_FORMAT = "dc:format";
    public static final String DC_TYPE = "dc:type";
    public static final String DC_CREATOR = "dc:creator";
    public static final String DC_LANGUAGE = "dc:language";
    public static final String SS_DATE_FORMAT = "yyyy-MM-dd";
    public static final String SS_DATE_FORMAT_ISO = "yyyy-MM-dd'T'HH:mm:ssZ";
    public static final String VALIDATOR_MULTIPLICITY = "n";
    public static final String PID_LABEL = "pid";
    public static final String QUDEX_PREFIX = "qudex";
   
    /* QuDeX CONSTANTS */
    public static final String QUDEX_INSTANCE_DS_CONTENT = "<qudex";
    public static final String DEF_QUDEX_NS = "qudex";
    public static final String QUDEX_ORIGINAL = "qudex:isOriginal";
    public static final String QUDEX_ORIGINAL_NONS = "isOriginal";
    public static final String QUDEX_ORIGINAL_REFERENCE = "originalReference";
    public static final String QUDEX_SOURCE_REFERENCE = "sourceReference";
    public static final String QUDEX_UPDATE_PID = "updatePid";
    public static final String QUDEX_DELETE_PID = "deletePid";
    public static final String QUDEX_INSTANCE_DS_NAME = "QudexInstance";
    //CATEGORIES
    public static final String CATEGORY_VALUE_HEADER = "category";
    public static final String CATEGORY_LABEL_HEADER = "labelCategory";
    public static final String CAT_LABEL_PREFIX = "cat_";
    public static final String CAT_DS_NAME = "CATEGORY-SNIPPET";
    //CODES
    public static final String CODE_VALUE_HEADER = "code";
    public static final String CODE_LABEL_HEADER = "labelCode";
    public static final String CODE_LABEL_PREFIX = "code_";
    public static final String CODE_DS_NAME = "CODE-SNIPPET";
    //MEMOS
    public static final String MEMO_VALUE_HEADER = "memo";
    public static final String MEMO_LABEL_HEADER = "labelMemo";
    public static final String MEMO_LABEL_PREFIX = "memo_";
    public static final String MEMO_DS_NAME = "MEMO-SNIPPET";
        

    public static final HashMap<String, String> fedoraErrorCodes = new HashMap<String, String>();
    static {
	fedoraErrorCodes.put("authorization",
		"Authorization errors when accesing the given object.");
	fedoraErrorCodes.put("DatastreamLockedException",
		"Errors managing object datastreams.");
	fedoraErrorCodes.put("DatastreamNotFoundException",
		"Datastream not found for the object.");
	fedoraErrorCodes
		.put(
			"GeneralException",
			"General error when performing operation in the object, consult the administrator.");
	fedoraErrorCodes.put("HttpServiceNotFoundException",
		"Connection errors when trying to access Fedora instance");
	fedoraErrorCodes
		.put("LowlevelStorageException",
			"Errors when storing data in the repository, consult the administrator.");
	fedoraErrorCodes
		.put("LowlevelStorageInconsistencyException",
			"Errors when storing data in the repository, consult the administrator.");
	fedoraErrorCodes.put("MalformedPidException",
		"Errors in the PID, invalid format. Check the format.");
	fedoraErrorCodes.put("MethodNotFoundException",
		"Operation not found in the repository, check the operation.");
	fedoraErrorCodes
		.put("MethodParmNotFoundException",
			"Errors in the parameters of the request, consult the administrator.");
	fedoraErrorCodes
		.put(
			"ObjectAlreadyInLowlevelStorageException",
			"Revise the PID in your spreadsheet, attempting to store an object which already exists.");
	fedoraErrorCodes
		.put(
			"ObjectDependencyException",
			"Check the spreadsheet, error in objects' relationships, e.g. an object is a member of another that is not stored yet.");
	fedoraErrorCodes
		.put(
			"ObjectExistsException",
			"Revise the PID in your spreadsheet, attempting to store an object which already exists.");
	fedoraErrorCodes
		.put("ObjectIntegrityException",
			"Storage issues for the given object, consult the administrator.");
	fedoraErrorCodes
		.put("ObjectLockedException",
			"Storage issues for the given object, consult the administrator.");
	fedoraErrorCodes
		.put(
			"ObjectNotFoundException",
			"Attempting to work with an object which does not exist in the repository, consult the administrator.");
	fedoraErrorCodes
		.put("ObjectNotInLowlevelStorageException",
			"Storage issues for the given object, consult the administrator.");
	fedoraErrorCodes.put("ObjectValidityException",
		"Object not valid, consult the administrator.");
	fedoraErrorCodes
		.put("ResourceIndexException",
			"Error while updating the triplestore, consult the administrator.");
	fedoraErrorCodes.put("ValidationException",
		"Object FOXML not well formed, consult the administrator.");
    }
}
